<c:if test="true"
  xmlns="http://www.w3.org/1999/xhtml"
  xmlns:c="http://java.sun.com/jstl/core"
  xmlns:f="http://java.sun.com/jsf/core"
  xmlns:nxu="http://nuxeo.org/nxweb/util"
  xmlns:nxd="http://nuxeo.org/nxweb/document"
  xmlns:nxh="http://nuxeo.org/nxweb/html"
  xmlns:nxl="http://nuxeo.org/nxforms/layout"
  xmlns:h="http://java.sun.com/jsf/html"
  xmlns:nxp="http://nuxeo.org/nxweb/pdf">
<nxu:set var="typeLabel" value="#{nxd:typeLabel(field)}">
<nxu:set var="label" value="#{empty field_2 ? messages[typeLabel] : messages[field_2]}">
<c:if test="#{nxl:isLikePlainMode(widget.mode)}">#{nxd:titleOrId(field_0)}</c:if>
<c:if test="#{nxl:isLikeViewMode(widget.mode)}">

  <div class="popupTarget" docRef="#{field_1}">

    <nxd:restDocumentLink document="#{field_0}"
      tab="#{widgetProperty_tab}"
      subTab="#{widgetProperty_subTab}"
      tabs="#{nxu:test(tabWidgetTabs == null, widgetProperty_tabs, tabWidgetTabs)}"
      target="#{widgetProperty_target}"
      view="#{nxu:test(empty tabWidgetView, widgetProperty_view, tabWidgetView)}"
      pattern="#{nxu:test(empty tabWidgetPattern, widgetProperty_pattern, tabWidgetPattern)}">
      <span id="title_#{field_1}" title="#{label}" class="documentTitle">
       <c:if test="#{widgetProperty_localize}">
        #{messages[nxd:titleOrId(field_0)]}
       </c:if>
       <c:if test="#{!widgetProperty_localize}">
         #{nxd:titleOrId(field_0)}
       </c:if>
      </span>
    </nxd:restDocumentLink>

    <c:if test="#{!widgetProperty_hideExternalLink}">
      <nxd:restDocumentLink document="#{field_0}"
        newConversation="true" target="_blank"
        tab="#{widgetProperty_tab}"
        subTab="#{widgetProperty_subTab}"
        tabs="#{nxu:test(tabWidgetTabs == null, widgetProperty_tabs, tabWidgetTabs)}"
        view="#{nxu:test(empty tabWidgetView, widgetProperty_view, tabWidgetView)}"
        pattern="#{nxu:test(empty tabWidgetPattern, widgetProperty_pattern, tabWidgetPattern)}">
        <nxu:graphicImage value="/icons/external.gif"
          style="vertical-align:middle"
          alt="#{messages['permalink.newTab']}"
          title="#{messages['permalink.newTab']}" />
      </nxd:restDocumentLink>
    </c:if>

    <c:if test="#{!widgetProperty_hideDownloadLink}">
      <nxh:outputLink
        rendered="#{field_0.hasSchema(widget.properties.file_schema) and !empty field_3}"
        value="#{nxd:fileUrl('downloadFile', field_0, widget.properties.file_property_name, field_4)}"
        styleClass="documentDownloadLink">
        <nxh:graphicImage value="/icons/download.png"
          title="#{nxd:fileDescription(field_0, widget.properties.file_property_name, widget.properties.filename_property_name, field_4)}"
          alt="#{nxd:fileDescription(field_0, widget.properties.file_property_name, widget.properties.filename_property_name, field_4)}" />
      </nxh:outputLink>
    </c:if>

  </div>

</c:if>
<c:if test="#{widget.mode == 'pdf'}">
  <nxp:html>
    <c:if test="#{widgetProperty_localize}">
      #{messages[nxd:titleOrId(field_0)]}
    </c:if>
    <c:if test="#{!widgetProperty_localize}">
     #{nxd:titleOrId(field_0)}
    </c:if>
  </nxp:html>
</c:if>

</nxu:set>
</nxu:set>
</c:if>